const isLogin = () => !!localStorage.getItem("token"); // 判断是否有token(是否登录)
const getToken = () => localStorage.getItem("token"); // 获取token
const setCart = (num: Number) =>
  localStorage.setItem("cartlength", String(num)); // 存购物车商品数量
const getCart = () =>
  // 获取购物车商品数量
  localStorage.getItem("cartlength")
    ? Number(localStorage.getItem("cartlength"))
    : localStorage.getItem("cartlength");
export { isLogin, getToken, setCart, getCart };
